package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Role entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_ROLE", uniqueConstraints = @UniqueConstraint(columnNames = "ROLE_ID"))
public class Role implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2755268474171761008L;
	private String roleId;
	private String roleName;
	private String roleStatus;

	// Constructors

	/** default constructor */
	public Role() {
	}

	/** full constructor */
	public Role(String roleId, String roleName, String roleStatus) {
		this.roleId = roleId;
		this.roleName = roleName;
		this.roleStatus = roleStatus;
	}

	// Property accessors

	@Id
	@Column(name = "ROLE_ID", unique = true, nullable = false, length = 3)
	public String getRoleId() {
		return this.roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	@Column(name = "ROLE_NAME", nullable = false, length = 40)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "ROLE_STATUS", nullable = false, length = 1)
	public String getRoleStatus() {
		return this.roleStatus;
	}

	public void setRoleStatus(String roleStatus) {
		this.roleStatus = roleStatus;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Role))
			return false;
		Role castOther = (Role) other;

		return ((this.getRoleId() == castOther.getRoleId()) || (this
				.getRoleId() != null && castOther.getRoleId() != null && this
				.getRoleId().equals(castOther.getRoleId())))
				&& ((this.getRoleName() == castOther.getRoleName()) || (this
						.getRoleName() != null
						&& castOther.getRoleName() != null && this
						.getRoleName().equals(castOther.getRoleName())))
				&& ((this.getRoleStatus() == castOther.getRoleStatus()) || (this
						.getRoleStatus() != null
						&& castOther.getRoleStatus() != null && this
						.getRoleStatus().equals(castOther.getRoleStatus())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getRoleId() == null ? 0 : this.getRoleId().hashCode());
		result = 37 * result
				+ (getRoleName() == null ? 0 : this.getRoleName().hashCode());
		result = 37
				* result
				+ (getRoleStatus() == null ? 0 : this.getRoleStatus()
						.hashCode());
		return result;
	}

}